<template>
  <div>
    <el-form ref="form" :model="form" label-width="80px" style="display: flex;">
      <el-form-item label="车牌号码">
        <el-input v-model="inputNum" placeholder="请输入车牌号码" />
      </el-form-item>
      <el-form-item label="车主姓名">
        <el-input v-model="inputNum" placeholder="请输入车主姓名" />
      </el-form-item>
      <el-form-item label="状态">
        <el-input v-model="inputNum" placeholder="未选择" />
      </el-form-item>
      <el-button style="height: 40px;margin-left: 10px;">查询</el-button>
    </el-form>
    <div>
      <el-button>添加月卡</el-button>
      <el-button>批量删除</el-button>
    </div>
    <template>
      <el-table
        ref="multipleTable"
        :data="tableData"
        tooltip-effect="dark"
        style="width: 100%"
        @selection-change="handleSelectionChange"
      >
        <el-table-column type="selection" width="55" />
        <el-table-column prop="id" label="序号" width="100" />
        <el-table-column prop="poleName" label="一体杆名称" width="150" />
        <el-table-column prop="poleNumber" label="一体杆编号" show-overflow-tooltip />
        <el-table-column prop="poleIp" label="一体杆IP" show-overflow-tooltip />
        <el-table-column prop="areaName" label="安装区域" show-overflow-tooltip />
        <el-table-column prop="poleType" label="一体杆类型" width="120" show-overflow-tooltip>
          <template v-slot="{ row }">
            <span v-if="row.poleType === 'entrance'">入口</span>
            <span v-else>出口</span>
          </template>
        </el-table-column>
        <el-table-column prop="poleStatus" label="运行状态" width="100" show-overflow-tooltip>
          <template v-slot="{ row }">
            <span v-if="row.poleStatus === 1">异常</span>
            <span v-else>正常</span>
          </template>
        </el-table-column>
        <el-table-column label="操作">
          <template>
            <el-button size="mini" type="text">续费</el-button>
            <el-button size="mini" type="text">查看</el-button>
            <el-button size="mini" type="text">编辑</el-button>
            <el-button size="mini" type="text">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
    </template>
  </div>
</template>

<script>
import { getPoleInfoList } from '@/api/allinonepole'
export default {
  data() {
    return {
      params: {
        name: '',
        page: 1,
        pageSize: 10
      },
      form: {

      },
      inputNum: '',
      tableData: []
    }
  },
  created() {
    this.getPoleInfoList()
  },
  methods: {
    handleSelectionChange(val) {
      this.multipleSelection = val
    },
    async getPoleInfoList() {
      const res = await getPoleInfoList(this.params)
      console.log(res)
      this.tableData = res.rows
    }
  }

}
</script>

<style>
.clearfix {
    display: flex;

}
</style>
